﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ExamUtils;

namespace ExamServerDAL
{
    /// <summary>
    /// mysql数据库连接类
    /// </summary>
    [Serializable]
    public class MySQLConnectInfo
    {
        /// <summary>
        /// 主机
        /// </summary>
        public string MysqlHost { get; set; }

        /// <summary>
        /// 端口号
        /// </summary>
        public int MysqlPort { get; set; } = 3306;

        /// <summary>
        /// 用户名
        /// </summary>
        public string Username { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        private string password;

        /// <summary>
        /// 使用base64编码, 不是加密
        /// </summary>
        public string Password
        {
            get => Base64Utils.Base64Decode(password);
            set => password = Base64Utils.Base64Encode(value);
        }
    }
}
